﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DataFrameworkAccess.Entity;
using System.Data;
using Xinkui.Common.FileAction;
using Xinkui.Common.Enum;
using Back.Xinkui.Common;
using Back.Xinkui.Common.Enum;

namespace Back.Xinkui.Entity.Company
{
    public class ProdcutEntity
    {

        [DataMapping("ProductID", DbType.Int32)]
        public int ProductID { get; set; }


        [DataMapping("ProductName", DbType.String)]
        public string ProductName { get; set; }

        [DataMapping("CompanyName", DbType.String)]
        public string CompanyName { get; set; }


        [DataMapping("CategoryID", DbType.Int32)]
        public int CategoryID { get; set; }


        [DataMapping("CompanyID", DbType.Int32)]
        public int CompanyID { get; set; }


        [DataMapping("UserID", DbType.Int32)]
        public int UserID { get; set; }


        [DataMapping("ProductDescription", DbType.String)]
        public string ProductDescription { get; set; }


        [DataMapping("PlaceOfOrigin", DbType.String)]
        public string PlaceOfOrigin { get; set; }


        [DataMapping("MainKeyword", DbType.String)]
        public string MainKeyword { get; set; }


        [DataMapping("Keywords", DbType.String)]
        public string Keywords { get; set; }


        [DataMapping("OEMNO", DbType.String)]
        public string OEMNO { get; set; }


        [DataMapping("CertificateIDS", DbType.String)]
        public string CertificateIDS { get; set; }


        [DataMapping("GroupID", DbType.Int32)]
        public int GroupID { get; set; }


        [DataMapping("KeyProducts", DbType.Int32)]
        public int KeyProducts { get; set; }


        [DataMapping("Application", DbType.String)]
        public string Application { get; set; }


        [DataMapping("PicImgs", DbType.String)]
        public string PicImgs { get; set; }


        [DataMapping("IsDeleted", DbType.Boolean)]
        public bool IsDeleted { get; set; }


        [DataMapping("CreateDate", DbType.DateTime)]
        public DateTime CreateDate { get; set; }


        [DataMapping("CreateIP", DbType.String)]
        public string CreateIP { get; set; }


        [DataMapping("UpdateDate", DbType.DateTime)]
        public DateTime UpdateDate { get; set; }


        [DataMapping("UpdateIP", DbType.String)]
        public string UpdateIP { get; set; }


        [DataMapping("AuditDate", DbType.DateTime)]
        public DateTime AuditDate { get; set; }


        [DataMapping("AuditStatus", DbType.Int32)]
        public EAuditStatus AuditStatus { get; set; }

        public string viewImage
        {
            get
            {
                string certImg = FileFactory.BrowerFile(PicImgs, ESourceType.FromProductImage, 100, 100);
                return string.IsNullOrEmpty(certImg) ? "/Themes/default/images/Img/noimage.jpg" : certImg;
            }
        }

        public string viewAuditStatus
        {
            get
            {
                return EnumHelper.EnumToString(AuditStatus);
            }
        }
    }
}
